﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WinformTest
{
    public partial class Form2 : Form
    {


        public string value2 = "";

        private string _ShowValue;
        public string ShowValue
        {
            get
            {
                return _ShowValue;
            }
            set
            {
                if (value.Length > 10)
                {
                    //MessageBox.Show("不允许进行赋值操作");
                    _ShowValue = "1234";
                }
            }
        }

        public Form1 form1;
        public Form2()

        {

            AppData.Instance.changeValueEventHanler += Form1_changeValueEventHanler;
            InitializeComponent();
        }

        private void Form1_changeValueEventHanler(object sender, TransEventArgs e)
        {
            label2.Text = e.TransValue;
        }

        //Form Load 初始化窗体完成 
        private void Form2_Load(object sender, EventArgs e)
        {
            AppData.LableTrans = label1;
        }
    }


    public class TransEventArgs : EventArgs
    {
        public string TransValue
        {
            get;
            set;
        } = "";
    }
}
